<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<aside class="main-sidebar">
    <!-- sidebar: style can be found in sidebar.less -->
    <section class="sidebar">
        <!-- Sidebar user panel -->
        <div class="user-panel">
            <div class="pull-left image">
                <img src="/images/user2-160x160.jpg" class="img-circle" alt="User Image">
            </div>
            <div class="pull-left info">
                <!--<p>${session.current_user.username}</p>-->
                <!--<a href="#">${session.current_user.roles[0].roleName}</a>-->
                    <p th:utext="${session.current_user.userName}"></p>
                <th:block th:unless="${#lists.isEmpty(session.current_user.roles)}">
                    <a href="#" th:utext="${session.current_user.roles[0].roleName}"></a>
                </th:block>
            </div>
        </div>

        <!-- sidebar menu: : style can be found in sidebar.less -->
        <ul class="sidebar-menu">

            <th:block th:each="e,index:${session.menus}">
                <li class="treeview">
                    <a href="javascript:void(0);">
                        <i th:class="'fa fa-' + ${e.icon}"></i>
                        <span th:text="${e.menuName}"></span>
                        <span class="pull-right-container">
                    <i class="fa fa-angle-left pull-right"></i>
                    </span>
                    </a>
                      <ul th:if="${session.node ne null && e.menuId eq session.node.parentId}" class="treeview-menu menu-open" style="display: block;">
                          <th:block th:each="child, i:${e.children}">
                              <li th:if="${session.node ne null && child.menuId eq session.node.menuId}" class="treeview active">
                                  <a th:href="${child.path}">
                                      <i th:class="'fa fa-' + ${child.icon}"></i>
                                      <span th:text="${child.menuName}"></span>
                                  </a>
                              </li>
                              <li th:if="${session.node eq null || child.menuId ne session.node.menuId}">
                                  <a th:href="${child.path}">
                                      <i th:class="'fa fa-' + ${child.icon}"></i>
                                      <span th:text="${child.menuName}"></span>
                                  </a>
                              </li>
                          </th:block>
                      </ul>
                       <ul th:if="${session.node eq null || e.menuId ne session.node.parentId }" class="treeview-menu " style="display: none;">
                        <th:block th:each="child, i:${e.children}">
                            <li th:if="${session.node ne null && child.menuId eq session.node.menuId}" class="treeview active">
                                <a th:href="${child.path}">
                                    <i th:class="'fa fa-' + ${child.icon}"></i>
                                    <span th:text="${child.menuName}"></span>
                                </a>
                            </li>
                            <li th:if="${session.node eq null || child.menuId ne session.node.menuId}">
                                <a th:href="${child.path}">
                                    <i th:class="'fa fa-' + ${child.icon}"></i>
                                    <span th:text="${child.menuName}"></span>
                                </a>
                            </li>
                        </th:block>
                       </ul>

                    <!--</th:block>-->
                </li>
            </th:block>

            <li class="treeview">
                <a href="/sites/homePage" target="_blank">
                    <i class="fa fa-link"></i>
                    <span>门户网站</span>
                    <span class="pull-right-container">
                    <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
            </li>
        </ul>
    </section>
</aside>